In all present Silicon Graphics systems, there is only one EISA bus adapter, and its number is 0.
bustype | Specified as EISA for EISA devices. The VECTOR statement can be used for other types of buses as well. |
adapter | The number of the bus where the device is attached (0). |
iospace, iospace2, iospace3 | Each iospace group specifies the address space, starting bus address, and the size of a segment of bus address space used by this device. |
Within each iospace parameter group you find keywords and numbers for the address space and addresses for a device. The following is an example of a VECTOR line (which must be a single physical line in the system file):
This example specifies a device that resides in the I/O space at offset 0x1000 (the slot-1 I/O space) for the usual length of 0x1000 bytes. The exprobe_space parameter suggests that a key device register is at 0x1c80.VECTOR: bustype=EISA module=if_ec3 ctlr=1 iospace=(EISAIO,0x1000,0x1000) exprobe_space=(r,EISAIO, 0x1c80,4,0x6010d425,0xffffffff)
The naming convention for these files is as follows: Each file is named eisaBaM, where
B | is a digit for the bus number (0) |
M | is the modifier, either io or mem |
The device special file for the device described by the example VECTOR line in the preceding section would be /dev/vme/eisa0aio.
In order to map a device on a particular bus and address space, you must open the corresponding file in /dev/eisa.
This function is documented for all its many uses in the mmap(2) reference page. For purposes of mapping EISA devices, the parameters should be as follows (using the names from the reference page):
addr | Should be NULL to permit the kernel to choose an address in user process space. |
len | The length of the span of bus addresses, as documented in the iospace group in the VECTOR line. |
prot | PROT_READ, or PROT_WRITE, or the logical sum of those names when the device is used for both input and output. |
flags | MAP_SHARED, with the addition of MAP_PRIVATE if this mapping is not to be visible to child processes created with the sproc() function (see the sproc(2) reference page). |
fd | The file descriptor from opening the device special file in /dev/eisa. |
off | The starting bus address, as documented in the iospace group in the VECTOR line. |
The value returned by mmap() is the virtual memory address that corresponds to the starting bus address. When the process accesses that address, the access is implemented by data transfer to the EISA bus.
Note: When programming EISA PIO, you must always be aware that EISA devices generally store 16-bit and 32-bit values in "small-endian" order, with the least-significant byte at the lowest address. This is opposite to the order used by the MIPS CPU under IRIX. If you simply assign to a C unsigned integer from a 32-bit EISA register, the value will appear to be byte-inverted.